1. Field of the Invention
The present invention generally relates to coding of moving images and, more particularly, to a coding apparatus and a coding method that selectively apply field-based coding and frame-based coding.
2. Description of the Related Art
Moving image photographing apparatuses such as video cameras generally photograph moving images by interlaced scanning at a time interval of 1/60 sec. Methods for coding data of moving images photographed by such a video camera includes: field-based coding that codes each interlaced image (field) as is; and frame-based coding that codes a frame image synthesized from two consecutive interlaced images.
Since the scan lines of the image of each field are not successive, correlation between pixels in the perpendicular direction is weak compared to that of a frame image in which scan lines are successive. Hence, in terms of compression efficiency, frame-based coding is generally advantageous. However, in frame-based coding, when the amount of variation between the fields constituting a frame is large, edges of a moved object become comb-shaped in each line and correlation between the adjacent pixels in the perpendicular direction is significantly reduced. Thus, compression becomes difficult.
Therefore, conventionally, a technique has been proposed in which field-based coding is performed on a portion with large movement, whereas frame-based coding is performed on a part with small movement (refer to Japanese Laid-Open Patent Application No. 2002-64830 and Japanese Patent Gazette No. 2507199).
As mentioned above, which of frame-based coding and field-based coding is better is determined on case-by-case basis. However, frame-based coding is generally used because it is complicated to determine the amount of movement. In the case of applying frame-based coding, a problem occurs in that, when movement between fields is large, coding efficiency is reduced due to the above-mentioned comb-shapes and specific unnatural image degradation occurs.
A description is given of the image degradation. FIG. 1-(a) shows an interlaced image of the (n)th field, FIG. 1-(b) shows the interlaced image of the (n+1)th field after 1/60 second, FIG. 1-(c) shows a non-interlaced image of the frame obtained by synthesizing the interlaced images of the above-mentioned two fields. When an object moves rightward between the two fields as shown in FIG. 1, the right and left edge portions of the object on the frame image form comb-like shapes since edge portions in each scan line are shifted for plural pixels. FIG. 1-(d) shows a part of the comb-like edge portions in an enlarged manner. In FIG. 1-(d), “L” corresponds to the amount of movement between the fields.
In frame-based coding, the above-mentioned “comb-like shapes” cause a reduction in coding efficiency and specific unnatural image degradation.
Referring to FIG. 2, a further description is given of the unnatural image degradation. In a case where the vertical line located at the position shown in FIG. 2-(a) in the (n)th field moves to the position shown in FIG. 2-(b) in the (n+1)th field, the vertical line becomes two dotted lines as shown in FIG. 2-(c) in the frame obtained by synthesizing both fields. When the frame is decoded after being subjected to frame-based coding, under the influence of quantization (including truncation described below) at the time of coding, dots forming each of the dotted lines seem to be connected via dots of subtle colors as shown in FIG. 2-(d). Accordingly, two dotted lines appear in each of the fields shown in FIG. 2-(e) and FIG. 2-(f) decomposed from the decoded frame. As a result, when the decoded frame is decomposed into fields and displayed in an interlaced manner on, for example, a television receiver, the original vertical line and an “after-image” vertical line thereof appear in each of the fields. Thus, the single original vertical line appears to be two vertical lines. FIG. 2 shows the case where the vertical line moves. In cases where not a line but a surface moves, the surface appears to be doubled or shifted to the right and left. Such a phenomenon is called “after-image phenomenon” in this specification.